<template>
  <div>
    <quill-editor :options="defaultOptions"></quill-editor>
  </div>
</template>

<script>
import { quillEditor } from "vue-quill-editor";
export default {
  data() {
    return {
      content: "this is a simple demo",
      defaultOptions: {
        theme: "snow",
        placeholder: "placeholder",
        // 编辑器的配置
        // something config
         modules: {
          toolbar: [
            ["bold", "italic", "underline", "strike","code-block"], //加粗，斜体，下划线，删除线
            [], //引用，代码块
            [{ list: "ordered" }, { list: "bullet" }], //列表
            [{ indent: "-1" }, { indent: "+1" }], // 缩进
            [{ size: ["small", false, "large", "huge"] }], // 字体大小
            [{ header: [1, 2, 3, 4, 5, 6, false] }], //几级标题
            [{ color: [] }, { background: [] }], // 字体颜色，字体背景颜色
            [{ align: [] }], //对齐方式
            ["clean"], //清除字体样式
            ["image", "video"] //上传图片、上传视频
          ]
       }

      },
    };
  },
  components: {
    quillEditor,
  },
  methods: {
    onEditorChange({ editor, html, text }) {
      //富文本编辑器  文本改变时 设置字段值
      console.log(editor, text);
      this.content = html;
    },
  },
};
</script>

<style>
</style>



